changed exam solution to use void pointers