syntax editing
little modification
Changed all c api functions to c++ api. Still buggy.