added comments and changed the main file