Now displays number of devices connected to the system!
Refactored code