add Pilot code (note that code from book doesn't compile; using Stig's workaround