Correct logic for detecting half time