Messed up loop fixed.