Added functionality for game ending scenarios.