long to sparse works but needs tidying up + tests.