converting C++ code to C , surf objects almost usable