modified ex1-17.c