Matrix type finally working