function tax = stateTax2019(agi)
%
%
%
brackets =   [ 8544     .01;
               20255    .02;
	       31969    .04;
	       44377    .06;
	       56085    .08;
	       286492   .093;
	       343788   .103;
	       572980   .113;
	       572981   .123];

% Standard deduction:
% taxable = agi - 6300;

taxable = agi;

if( taxable < 0 )
  fprintf('Taxable must be > 0.\n');
  return
end

tax = 0;
i = 1;
while( taxable > brackets(i,1) )
  if( i == 1 )
    tax = tax + brackets(i,1)*brackets(i,2);
  else
    tax = tax + (brackets(i,1)-brackets(i-1,1))*brackets(i,2);
  end
  i = i+1;  
  if( i > ( length(brackets) - 1 ) )
    break;
  end
end
tax = tax + (taxable - brackets(i-1,1))*brackets(i,2);

fprintf('\nEffective State Tax Rate = %.2f%%\n\n',tax/agi*100)

return
