Add Top K algorithm