updated gdistance.prep