The algorithm for OPE coefficient functions in the MS scheme