gen-pairs optimized