this should be a function declaration defined outside the if/else which possibly takes options, totalRows, and/or results as arguments