use struct to replace vector