add comment and define transformArr function