Removed typos and added more comments.