Implement changes fromchapter 5 exercises