working on ch1/ex16.c