First optimization

Added the function for the new game button and optimized the code a bit.