Fixing sample code