fixed spelling mistakes and added comments