first working version of calculating tax with deductions