modified main method