Update docs example usage to use return value instead of printing