all tests rewritten