Made changes to fix gameover not working error (still untested)