Add function for calculating moment of a list.