improved wakeup and sleep, added lots of logger messages