Broken Parsing but cleaned code. 

Parsing now broken into parse block to handle each element. Lots of debug code to find where parsing is breaking down.