resizing start/end calculation