test.c is a working prototype