Uncertain mining implementation (C++)