learn the basic of ruby, using a function to display title