Updating matrix to be able to delete array on the fly.