add type_align function to deal with two vectors with distinct types