This code may be freely used and modified for any purpose
providing that this copyright notice is included with it.
Copyright holder makes no warranty for this code, and cannot be held
liable for any real or imagined damage resulting from its use.
Users of this code must verify correctness for their application.