extracted C(n, k) and some more funcs