minor updates + stat now supports sparse matrices + fixed bugs