cleaned up some code
work on the two phase commit