added the first version, 3x improvement for small data set