Fixed the fix that actually broke my code to begin with. Also rearranged some tree building code for the cst to make it better