mean function added.