written * and put in the public domain by Mark Adler