Dealing with pointer to function