using coo matrices and lin table now the fastest