beginning if-then-table type

Also fixing duplicate rule problem