updated example, fixed undefined char bug