Added global print function to aid debugging