main function refactoring pause, time to sleep!