Modified script to match new interface