added more comments and changes