made the example consistent with the fuction definition and improved doc