Won't this work enough if size() == 1?  I assume the if (size == 1) is an optimization?