Added some notes to code.