initial code for spacesaving/topk