added function that compares vectors and one that writes vector to file