Finished hw3.c