binary tree implementation, but only with ordered trees