Superficially works, very hacky