Change threshold
Fix bug with endgame