modified examples to ch11 and 12 (program to interfaces)