added sorted srategy algorithm.