Added: removed print statements and added as statements for exceptions for python 3 compatibility (again!)