We study the effects of pension reform in a four-period OLG model for an open economy where hours worked by three active generations, education of the young, the retirement decision of older workers, and aggregate growth, are all endogenous. Within each generation we distinguish individuals with high, medium or low ability to build human capital. This extension allows to investigate also the effects of pension reform on the income and welfare levels of different ability groups. Particular attention goes to the income at old-age and the welfare level of low-ability individuals. Our simulation results prefer an intelligent pay-as-you-go pension system above a fully-funded private system. When it comes to promoting employment, human capital, growth, and aggregate welfare, positive effects in a pay-as-you-go system are the strongest when it includes a tight link between individual labor income (and contributions) and the pension, and when it attaches a high weight to labor income earned as an older worker to compute the pension assessment base. Such a regime does, however, imply welfare losses for the current low-ability generations, and rising inequality in welfare. Complementing or replacing this 'intelligent' pay-as-you-go system by basic and/or minimum pension components is negative for aggregate welfare, employment and growth. Better is to maintain the tight link between individual labor income and the pension also for low-ability individuals, but to strongly raise their replacement rate.