fixed the header file and improved the sample example