changed c-code to working version for Eclipse