Fixed many classes and added test classes to test the implementation