Added some notes on the structure of the code.