added scratch_length