Replaced printf with std::cout