Added code for calculating original_start and original_end for expansion