Modifying tolerance threshold to be between 0 and 1.