Added comments and fixes file name bug