Implemented all 4 initial steps of state 1 with all logic.