fix in size determination for new matrix