changed struct to a class