maxDistance, changes to allow build from git