Added limit that only one layer of sub gate