added function that outputs array value(s) if scalar