version 2.0.0. Added gdistance option