Added outputting the result into a vector.