change algorithm in get_device_price()