Implemented binary tree and needed methods