implementing simple work and rest