implemented binary tree datastructure, edited functions to work with the new datastructure