Spike algorithm

everything in here is working. fuck.