completed exercise in Programming Elixir chapter 11