chapter9 (command pattern)