Updated gaps import function