completed code for creating and running function pointers