refactoring to include option of linear or quadratic rls or nlms