elixir exercise from PragProg Elixir book