improve rows routine