minor syntax changes to be python 3 compatible