demo code according to 'stanford Objective-C class'