major update to directory search

merged fine so hopefully no conflicts arise