Imported chapter two from Steven Halim book supplementary material.
Just re-format source codes.