only calculating mean once, and stats design work