some not very good tests, one day i will unit test this stuff properly