Changed to a new state based system which alled for more ease with passing variables between states