add directory code and document