encoding.rb week 4 refactor using lambda