much better sleep implementation