try using function pointers