fixed mean function to add floats