moved main method to the bottom of the file