optimized divide