private static ushort[] CreateIndexDictionary(ushort[] genes) { ushort[] indexDictionary = new ushort[genes.Length]; for (int i = 0, n = genes.Length; i < n; i++) { indexDictionary[genes[i]] = (ushort)i; } return indexDictionary; } }