reformat code sample and add doc link