Finish homework5.c