Added some comments/notes to the code