First try at file tree expansion function