Gutted and rewrote. Much better. Only two failing tests