final changes to main method