Implemented sleep cycle with the ability to be called as a script/no import