A stochastic-dynamic approach to pension funding