planning out improvements to this script. improved it slightly by letting specifying of path to search from