how to add length to matrix line