sort an array based on another array