If you can hold off for a bit, I will post an even simpler approach that eliminates the mean/average calculation entirely while still giving identical results. @Peter Nachtwey knows what that approach is already, but graciously chose to not steal my thunder (thanks, Pete!).
