use hash.keys.index() to find hash index, instead of using another hash