changing example to match new format with callbacks