Changed format for array elements and pushing them one by one instead