Added a few lines to the module to prepare for the state machine logic and setup the reset.