Solution to array_hash