handling row math calcs