implemented the Turning-point test