Updates to remove stats toolbox dependency