Removed the reduction by 1 from the assignment of the 'end' value to pass correct offsets to slice()