start fixing the high cost induced by using set from libcpp