checkpoint commit, all buggy
fix bugs, add state machine for endpoint. seems to be working