Handled the case of array with 2 or 3 components