Improving sample code for 'The Trouble With Traits'