fixed function pointers to work for structs as well