how to loop animations on its origin and restrict it from covering distance

i have used a bvh file for walk cycle and this walk cycle is covering distance while walk but i want to restrict it to its origional position.
Any idea how this can be done.
thanks.