adding sample code and correcting typo