added function for writing result of vector result