Added version with array that simulates bitshifting