added robust mean function