Added comments. Tried to implement watchdog and failed.