improved script for overlaying resolutions