define the union variable at the beginning of the function (maybe also *register*) to save some memory.