Added some comments and small changes.