gateway recursive