reduced redundant comparison in base case of insert