Continued work on device managment. Now almost done.