added structs inside functions