I'm afraid you haven't really made your problem very clear, you posted a number of times on the same issue, and you didn't post any sample data at first. For all of these reasons, yours was not an inviting question to attempt to answer, and people just ignored it.
I think I understand what you want given the sample data, but I'm not entirely sure. Attached is a modified version of your library with a new top-level file that does what I think you want to do.
Hope this helps, and keep in mind that if you avoid the things I listed above, you will get a faster answer in the future.