commit function 3