Updated structure and added tests.