Paul: code lib link
http://myweb.hinet.net/home4/s630417/