Added logging and renamed Module1 to Main.

Deleted more unneeded code