Total codes