Adding a generalized polynomial fit and examples