How to diversify your portfolio based on when you'll need money