Changed state machine

Also changed btn posedge for new state machine.