updated the arraylist, binarysearchtree and contract