begin main method