how to generate income from capital gains