changed the way sampling points is done