It's rather straightforward when you know how it works. Since only creative works are copyrightable, this code is in the public domain.B9A171