finished 4-7.c