In this work we consider a spring with one end is fixed and the other is connected to a block of mass M located on a horizontal rough table. The other side of the block is connected to a massless rope that passes over a frictionless pulley at the end of the table and a second block of mass m is hanged at the rope's other end. For this system, we analyze and discuss its dynamics of motion as function of time when the second block is released. In particular, the displacement of the system at the end of each half-cycle of motion, the total distance, and the work done against friction are derived. An interesting result is obtained for the case when the table is frictionless. It is found that there is still a work done by friction whose magnitude is exactly the same as the stored energy in the spring.