Fixed typos, added some notes and removed some code