updated example to match new API