function gout=payoff(s,k,type_op)
switch type_op
    case 'call'
        gout = max(s-k,0);
    case 'put'
        gout = max(k-s,0);
    otherwise
        fprintf('type of option not recognized!\n');
end
end