added starting code for lab 8, students basically fill in the code for all stages of the state machine