Although there are only a few weeks left to go before the year ends, it’s not too late to implement some planning moves that can improve your tax situation for 2018 and beyond. A few ideas for actions to take before Dec. 31 to improve overall tax picture:

Make HSA contributions. An individual is treated as having been eligible for the entire year regardless of the actual date of eligibility in 2018 and can therefore make a full year’s deductible-above-the-line contribution for 2018. The maximum contribution/deduction is $3,450 for individual coverage and $6,900 for family coverage (those age 55 or older also get an additional $1,000 catch-up amount).

Nail down losses on stock while substantially preserving one’s investment position. If you have experienced paper losses on stock in a particular industry in which you want to keep an investment, you may be able to realize losses on the shares for tax purposes and still retain approximately the same investment position. This can be accomplished by selling the shares and buying shares in another company in the same industry to replace them, or by selling the original holding then buying back the same securities at least 31 days later.

Apply a bunching strategy to deductible contributions and/or payments of medical expenses. Beginning in 2018, many taxpayers who claimed itemized deductions in prior years will no longer be able to do so because the standard deduction has been increased and many itemized deductions have been cut back or abolished. A bunching strategy can help by accelerating or deferring discretionary medical expenses and/or charitable contributions into the year you can itemize. For example, if you expect to itemize deductions in 2018 but not 2019, and usually contribute a total of $2,500 to charities each year, you can consider making a total of $5,000 of charitable contributions before the end of 2018 (and skipping charitable contributions in 2019). Keep in mind that the taxable income limitation for medical expenses increased from 7.5% in 2018 to 10% of adjusted gross income (AGI) in later years.

Be sure to take required minimum distributions (RMDs). If you have reached age 70-½, be sure to take your 2018 RMD from IRAs, 401(k) plans, or other employer-sponsored retired plans. Failure to take a required withdrawal can result in a penalty of 50% of the amount of the RMD not withdrawn. If you turned age 70-½ in 2018, you can delay the first required distribution to 2019. However, this deferral route will require a double distribution in 2019—the amount required for 2018 plus the amount required for 2018. This strategy could make sense if you will be subject to a lower tax rate next year.

Use IRAs to make charitable gifts. If you have reached age 70-½, own IRAs, and are making a charitable gift, consider a qualified charitable contribution (QCD) —a direct transfer from an IRA trustee to the charitable organization. Such a transfer (not to exceed $100,000) will neither be included in gross income nor allowed as a deduction on the tax return, but does count toward your RMD. The contribution will not increase AGI for purposes of the phase-out of any deduction, exclusion, or tax credit. A QCD before year end is a particularly good idea for retirees who don’t need all of their RMD for living expenses.

Wrap up a divorce. Alimony payments made under a divorce or separation agreement that is executed before Jan. 1, 2019, are deductible by the payor and included in the income of the payee. If made under a divorce or separation agreement executed after Dec. 31, 2018, the payor can no longer deduct the alimony payments and the payee doesn’t include them in income. Where the payor of alimony is in a higher marginal income tax bracket than the payee, it is beneficial for the divorcing spouses as a whole, for the alimony to be deductible to the payor and taxable to the payee. Thus, in most cases, couples in the midst of a divorce involving alimony payments should finalize that agreement by Dec. 31, 2018.

Make year-end gifts. A person can give any other person up to $15,000 in 2018 without incurring any gift tax. The annual exclusion amount increases to $30,000 per donee if the donor’s spouse consents to gift-splitting. Anyone who expects eventually to have estate tax liability and who can afford to make gifts to family members should do so. Besides avoiding gift tax, annual exclusion gifts take future appreciation in the value of the gift property out of the donor’s estate, and shift the income tax obligation on the property’s earnings to the donee who may be in a lower tax bracket. Special consideration should be made if recipient will be subject to the kiddie tax that can be as much, or more, than the donee’s tax.