Added some comments and changed format.