changed structs to be unions