added print statements to aid debugging.
added print statements to aid debugging.v2