Added some commments to the code.