more changes to make python 3.X compatible