changed array to hash