X-Bar: added c file
converting python code to c code