cleaned up Main