add length array (untested)