added iterative ruby pally