改进算法

improved algorithm