added getDreg
added sparseN