If you would prefer not to use Javascript, here is a simplified version of the code that does not include all of the statistical features: