elegant data structrue, but last sample overtime, I believe it's because c++ I/O, TODO