Edit this sentence so that it contains only one verb tense.
He had been walking for miles when he suddenly encountered a bear.
He walked for miles when he suddenly encountered a bear.
Complete the following task based on the instruction and optional input provided.### Instruction:
Edit this sentence so that it contains only one verb tense.
He had been walking for miles when he suddenly encountered a bear.

### Output:
He walked for miles when he suddenly encountered a bear.