Added gates mod (by addi)