add variable size to explode function