clean up .C code
improvements to networx