added a mean function because mean functions sometimes mysteriously don't work
need readme