code for ex 2.61