Improved class Number and game logic.