 
   """
   @spec delete_at(tuple, non_neg_integer) :: tuple
-  def delete_at(tuple, index) do
+  def delete_at(tuple, index) when is_integer(index) and index >= 0 do
     :erlang.delete_element(index + 1, tuple)
   end
 


  """
  @spec insert_at(tuple, non_neg_integer, term) :: tuple
  def insert_at(tuple, index, value) do
    :erlang.insert_element(index + 1, tuple, value)
  end



  """
  @spec duplicate(term, non_neg_integer) :: tuple
  def duplicate(data, size) when is_integer(size) and size >= 0 do
    :erlang.make_tuple(size, data)
  end

