Could you mock up a small example of what the data looks like (I think I'm clear on that part), and what you want the "output" to be (not so clear on that)?