Improved public search script