mod table scheme and some codes