Added compute of squared distanced
Also added distance squared into the data structure so it can be evaluated later.