tri-state code max length fixed