Added main method and cleaned up some comments