added method to call a function on rows