rewrote the algorithm in recursive style
fixed tree traversal + docs
use orderinglist
CRLF bug
added test file
flake8 fixes