Added some comments and removed unnecessary test code.