started restart game function and fixed a few bugs