Add 3 functions to calculate GC with known order fast.