Somewhat working Stats programme. Unsure that it's working
properly, but it compiles and runs.