refactored sleep out into pause function