fixed mean function to correctly test for floats