defensive: coercing to array to prevent fatals
merging the two scripts into one