first half of commit
second half