How a game-based approach to teaching helps improve learning