add matrix code
fix warning