added simple directory loop