changed structs to classes