changed the array to hash in the script