Added Matrix implementation