more algorithms from another repo - consolidating