Add file outputting with sub directories