rewrite chapter5