move quadpts selection to functions