changed demo code to use new quad2d function