Including the smat() definition, and making the use of sparse matrix optional