Finish implementing sleep