added -in and -out option to remove the limit of only running in a single directory