changed struct data into a class with update and send methods