Add detailed comments to logicalShift