Added automatic directory ignoring and a -d flag to disable directory ignoring