working binary tree implementation.