Modified main method