added main gateway interface code