added john's changes for branching and stalling to master