Implemented task 3
Implemented extended matrix for 3