adapt for vector input