a bit of formatting and improvements to branch simulation