added option to only retrieve topk with weights