reworked the array joining