added control of number of points in example 6.2