Working program. less frequent spikes.But 3 ms slower on the fast case.