Cleaned up main file.

Just cleaned up the main file. The Test class is messy, will sort it
later.