exact replica of basic.c from the c driver