add topK algorithm