made isMultiple util function more general