Refactored a bit, autogen destination.txt