Adjusted script to fit new system