cleaned up code and redirected start of program to Main in logic