edited example
added type identifier to field
renamed template parameters
renamed template parameters
added support for different record types
added functions