forgot to account for end gaps