Added typedef SourceBufferSize
Fixed type declarations so Matrix will compile with J > 1
working on J>1. Still works with J=1, K=1