first version of a function getting a structure value