matrix functionality update