implement kmax in base frag alg