Cleaned up code as it was initially written in a rush and added comments
Corrected bug with the "play again" button not displaying.