working on python optimization chapter