(CSCS2650) Added edge flip flop to logic