Correct buildTree function.
Add findReasonableEpsilon.
Add more sophisticated buildTree.