added size tracking in FFI
compacted L matrices