Partially rewrote iteration.js per beef broth's instructions