implemented createBinTree