Changed spike detection. Now it's performed immediately after occuring