Added some comments and renamed two classes for readability.