Mostly done I think, there's a test case!