exercise from the book "Refactory", ruby edition"