Local logic worked out; not compiling, no tests yet