added a length matrix