For #53 got all test working, but a bit of a hack