Refactored tolerance to constant.