some errors still working it out but the tests exist