updated BST and merged max ad min PQ to one class