some new reweighting tools, a branch handler and small modifications