convert to pure C and Chipmunk