added parameter to switch between linear and quadratic sample data