added print functions for debug output