Added some comments and deleted a unused line of code.