Used Array.join() method instead of making the string manually