Add matrix library