Some small improvement on taking the mid number