second version of functions.rb