Mean covar and command building function added