Files adapted/copied from:

 https://github.com/sipa/bips/
 Commit b65cd694676096dd31ea790485a2019ca653b34f by Mark Lundeburg
