add and fix more tests, update greg.c