Optimal retirement planning with a focus on single and joint life annuities