Adding remaining logic to include trimming/offset support.