fixed typos and added comments
removing trailing spaces