Retain hierarchy for output. Find unique names instead of blindly grabbing filename