example code from book also test code for mod 5