update examples to be compatible with python 2.7 and python 3.3