code to debug offset and ending point and adjacent gate connections