Get rid of dependence on stats toolbox

Signed-off-by: Ruben Merz <ruben.merz@ieee.org>