Integrated Robin's work for BR and DSA algorithms, but not adapted yet