Performance adjustments for addRow function