Added some comments and updated the header.