REV 4

Cleaned up some code in main.