cleaned up Main

made main a little less cluttered.  consolidated some functionality.