From https://github.com/alecjacobson/gptoolbox
