translate mean, draft revision of numeric in scala