changed structs to records