What role did gravity play in the formation of the sun?