Added file slicing functionality