chapter5c fixes