Added a few skeleton functions from the internet, added pruning function