add more debug code
fix initialisation of sparse amtrix

*** WORKING ***