Technology making addiction treatment safer and more effective