Rewrote datastructure parser

Trees always trip me up.