Minimize row routine reworked