bunch of changes to get the tests working