move stack struct to class