Improved algorithms and testing mode