adjust remainder in last chunk