Added functiont to reutnr number of peripherals