Add maxk, and change the algorithms.
Change the way of adding Maxk.