replaced fprintf with std::cout and use now c++11 braces init