Implemented a smarter way to sleep ;)