Update Gates.m