added toArray(_) to API