Modified the serial for loops to work when nested, updating tests