the source code is from Nsd tutorial, and modified by me