cleaning up code and adding basic pruning