Added time checking for initialisation and authentication. Moved sleep
command at end of loop.