Fix implementation enough to get a working proof-of-concept