Based completely off of: https://github.com/caesar0301/pyTree, all credit goes to the creator