Added comments and new test class as well as modification of some legacy code..