capi example slightly improved