Initial implementation of subsequence sorter