Using collective variables to drive molecular dynamics simulations