cgen works and compiles, but cannot query :/