improved Python 3 compatibility
update README.md
made examples/math.py Python3 compatible