Implementation of two different strategies for calculation of search length.

Will be changed.