slightly changed timing logic, such that spikes are in the right bin