Completed the main method