It looks like data is added to the output that was not in the input. Where is that supposed to come from? In addition dollar amounts move around to different dates. How does this occur?
Or are you just looking for the general format of the output (ignoring the data within)?