Refactored code

I found your repository and wanted to contribute this project. At this point, I couldn't get the original program to work, so I had to make only small changes. I refactored the code a little and tried to make it a bit more readable. Once I fix the initial problem, I will be able to actually add features to this game.