A model for tokamak confinement