Improved centering math logic. Still sucks.