Impementation done quickly, test passes but probably should be redone