compactified example code