Adding matrix data structure