upgraded code to python 34