Changed purity and stability methods to reduce run time