Dynamics of dark energy