Fixed typos and added some comments.