added sleep() and wake()