converted for loops, replaced couple missing ellipses and suppressed variables