Added dtype and changed default scipy matrix to lil_matrix