sample code for ruby book tutorial 3