More work on matrix library