finished rewriting programming chapter