Major changes: algo improvements