update functions.rb so that code runs correctly