improved test script