minor changes to main method