Add base directory retrieval code