A 1300 g mass is on a horizontal surface with μk = 0.380, and is in contact with a compressed massless spring with a spring constant of 600 N/m. When the spring is released, it does 8.61 J of work on the mass while returning to its equilibrium position. Calculate the distance the spring was compressed. Also, what is the velocity of the mass just as it loses contact with the spring? Any help would be appreciated, I'm pretty lost with this one.