Updated ex6.c