Adapted classes and added tests
Adapted classes and added tests