changed syntax to c++ for readability