some usefull algorithm.