Commit algorythm