Fixed indentation; added __main__ handling, and interuptible sleep to main loop