simplified median finding logic; changes in reconstruct binary tree