fixing the tax calculation logic