Final working code

Code that does all the functions we need to a game