ex8.c and extra credit