created ch3d.c, still incomplete