Improve Array perfomance

Instead of division use bitshifting.