Changed array to a hash