minor modification
new practice programs from chapter3