improved comments and added more comments