Changed threshold check to >= instead of > derr