created device script, moved device motion logic from input to the device namespace.