avoiding using getNumCapabilities.