an exercise in iOS programming