removed excess lines and added more comments