commit includes ex4.c and an additional test for valgrind