change k/2 to getParentPos(k)