How does commit work??