fixing arrays

Changed to hashes. Modifications within loop shouldn't be necessary.