improve fortune algorithm.