Use msg.length for regularization