Working but clunky version