write to text file method
Merge remote-tracking branch 'DistributedKNN/master'