refact, add matrix