add *.bak and __pycache__ to gitignore
rewrite chapter2 for python3