Metadynamics with flexible Gaussians