Spikegenerator

These two should be cdeffed for efficiency