Cleaned up Main for use in project