Add get_gates method