now allows vector input and output