Improved robustnes and added AlgorithmState