Code cleanup, description and minor corrections.

Corrected the sleep mode to idle for proper function.
Also corrected indentation and cleaned up unused stuff.