additions to c code