python 3 compatibility (mostly print statement fix)