 
   def chunk("", _), do: []
 
-  def chunk(str, trait) when trait in [:valid, :printable] do
-    {cp, _} = next_codepoint(str)
+  def chunk(string, trait) when trait in [:valid, :printable] do
+    {cp, _} = next_codepoint(string)
     pred_fn = make_chunk_pred(trait)
-    do_chunk(str, pred_fn.(cp), pred_fn)
-  end
-
-  defp do_chunk(str, flag, pred_fn), do: do_chunk(str, [], <<>>, flag, pred_fn)
+    do_chunk(string, pred_fn.(cp), pred_fn)
+  end
+
+  defp do_chunk(string, flag, pred_fn), do: do_chunk(string, [], <<>>, flag, pred_fn)
 
   defp do_chunk(<<>>, acc, <<>>, _, _), do: Enum.reverse(acc)
 
   defp do_chunk(<<>>, acc, chunk, _, _), do: Enum.reverse(acc, [chunk])
 
-  defp do_chunk(str, acc, chunk, flag, pred_fn) do
-    {cp, rest} = next_codepoint(str)
+  defp do_chunk(string, acc, chunk, flag, pred_fn) do
+    {cp, rest} = next_codepoint(string)
     if pred_fn.(cp) != flag do
       do_chunk(rest, [chunk|acc], cp, not flag, pred_fn)
     else

  end

  @compile {:inline, decompose: 1}
  defp decompose(str) do
    chars = graphemes(str)
    {chars, Kernel.length(chars)}
  end


  @doc """
  Returns a float value between 0 (equates to no similarity) and 1 (is an exact match)
  representing [Jaro](https://en.wikipedia.org/wiki/Jaro–Winkler_distance)
  distance between `string1` and `string2`.

  The Jaro distance metric is designed and best suited for short strings such as person names.

