somewhat broken union implementation