Add tests; further implementation