     rotate_left(str, x)
   end
   defp execute({:rotate_right, x}, str) do
-    rotate_left(str, x)
+    rotate_right(str, x)
   end
   defp execute({:move_position, x, y}, str) do
     {v, list} = List.pop_at(str, x)

    |> String.split("\n")
    |> Enum.map(&String.trim/1)
    |> Enum.map(&convert_cmds/1)
    |> Enum.reduce(String.to_charlist(str), &execute/2)
    |> to_string
  end


    {:move_position, x, y}
  end

  defp execute_wrapper(cmd, str) do
    IO.puts "#{inspect str}  -> #{inspect cmd}"
    result = execute(cmd, str)
    IO.puts "#{inspect result}"
    result
  end

  defp execute({:swap_position, x, y}, str) do
    swap_index(str, x, y)
  end
