type errors in forulas - corrected