Setting up the device