A 1772 g mass is on a horizontal surface with μk = 0.330, and is in contact with a massless spring with a force constant of 790 N/m which is compressed. When the spring is released, it does 6.68 J of work on the mass while returning to its equilibrium position. Calculate the distance the spring was compressed.