more attempts at generifying mean, rootMeanSquare