finished main functionality --- dynamic register/unregister of devices TO-DO