add gate setting functions.