How to work with 4 sets of data and 2 variables?

torquefreak:
So, where do I need to incorporate this in my code?

You mean that other person's code? Probably in 'rpm_calc()' if you want to store that latest four values for RPM.