Modified example to reflect new api