added cout and cerr