Adds commit function