Added sleep functionality and option