uses structs and arrays