Fixed sleep again
Made ranOnce public so it can be reset when the device wakes up