'Middlegame' makes mathematical magic