rearranged if statements
increased length reg_set signal
shift_reg now works on inverted clock so it is in sync with the slave clock