Add toDictionary() to array functions