debug() function now adds std::endl to message