pre-compute mean for speed
Merge pull request #6 from chills42/master

pre-compute mean for speed