More comments, and a correction from std::map<scalar_type, int> branch_ts; to std::map<int, scalar_type> branch_ts;.