Statement queries mostly done, need testing.