Added stuff to get correct elements of hashes