changed for in loops to $.each()

still in progresss…