added SortTemplate for sort algorithms