Add mean calculation in debug tools