Updated solve script