changed main method to more recent version