Added automatic directory iteration