algo improvements