Improved algorithm robustness + doc enhancements