cgates:Updating code to be minimally compatible with Python3.3