changes to lineclustering

could someone take a look at the k-means implementation, I am not sure
why i get the exception at memory location error