added structs as args for both functions