Updated bitshifting to use the >> operator instead of division.