Here's version 3 with much more precise specifications in the docstrings. If I recall correctly, the code itself is identical to version 2. Mark