changes to work with lower versions of python