updated arrayToWhere to format arrays