Imported from https://github.com/asaluja/spectral-scfg