added index_gt to c function