refactor code to make it work. didn't work. start working on game in java instead