function GBlackScholes = GBlackScholes( mCall, s , x , T , r , b , v  )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
   if (T <= 0)
      T = 0.000000001;
   end  % So we don't divide by zero
     d1 = (log(s / x) + (b + v * v / 2) * T) / (v * sqrt(T));
     d2 = d1 - v * sqrt(T);
   if (mCall)

   if (T > 0) 
     GBlackScholes = s * exp((b - r) * T) * xCND(d1) - x * exp(-r * T) * xCND(d2);
   else
     GBlackScholes = WorksheetFunction.Max(s - x, 0);
   end
   else
   if (T > 0)
     GBlackScholes = x * exp(-r * T) * xCND(-d2) - s * exp((b - r) * T) * xCND(-d1);
   else
     GBlackScholes = max(x - s, 0);
   end
   end

end
