challenge 12: complete intermediate in erlang