added tests and made tests pass