fixed mean function to correctly test for floats
by tyler