check for wraparound of unsigned int used to keep track of position in source