idk, I felt like I had to do something intelligent to make up for the absolutely terrible performance I gave in the math GCSE today :/
this uses the stack method for traversal, just wanted to challenge myself...