Ninth exercise of ruby