updated with c++11 standard