The code:

http://pastie.caboo.se/188207

The question:

Why isn't it doing them like nested folders? I'd like to get

.-----------------
| Parent folder
| .------------------
| | child folder
| |   child files
| |____________
__________

but I don't. Can anyone see whats wrong here? I'm losing my mind.
Thanks.