fixed the bugs! Moving on to the next state