Added the minimum Distance Algorithm - 3 November 2014