use a few left/right shifts instead of multiple/divide