SDM: Implemented dynamic calculation of the regularization parameter (and some sanity checks on the invertability of the feature matrix)