handles multiple inputs