Made most of the main program