initial gateway code