WIP: some queries working, tests passing