stretching with sliding reference window