Fix errors in mineTree function, and actually call it!