One final note to wrap things up. I posted a slightly cleaner version of my code on the Python Cookbook, with a reference to the solutions of Gonçalo and Danny via the tutor archives here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/363051 -- Email: singingxduck AT gmail DOT com AIM: singingxduck Programming Python for the fun of it.