edited code to remove main method