added shiftings to logic