support encoding type in the var name
modified types to allow buffers of different types
example with casting to a type