added more flip flops and combonational logic