handle arrays as input