I dislike both of these optimal functions (even though I wrote one of them) because they don't handle the edge cases very well. We should get rid of them unless you are using them (or rewrite them to work properly if you really want to)