extending arrays code