adjustLengths function

Adjust the length of the second argument to be the same as that of the first one