Use new metadata function

Updated example to use the new metadata method