added comments and fixed spelling mistakes