modify the code using C style