Replaced original parse code with my own parser which is more robust and able to convert a tree to a binary tree