Changed the distance function to actually return the distance between two words rather than their similarity (1 - distance).