Changed the script to use if instead of find