finished ex11.c