Small clarification, my original code.
It seems like everyone is using it (which is fine and why I post it anyway ).
Anyway, point is if there is a bug in the implementation then we can only determine that by seeing the whole program.