added math minimal distance example