update examples with python 3 compatible syntax