Modified exercise: ex4-2.c