added tests and they pass now