Added time integration and gravity