Cleaned up code + logic for game ending