updates to function handling