updated to C++11 api