Character code edit
Corrected getSubtrees

My black magic trick didn’t work so I switched to a while loop