added example_nnlsq and improved documentation