Cleaned up main class definition in terms of syntax, etc.