added rm.na to mean(x)