Fix example and reformat code