How is the device discount calculated?