use bit operations instead of power