Take a look into a JK Flip Flop implementation here in Community Tab, you can also implement with registers.