Sleep and Wake

Makes it so Sleep and wake are 99% working.