Improved resolution script