Modified for new devices.