Made changes to get input and output vectors from same method.