removed last pass over array