fixed print functions for python 3 compatibility