add a msglist, use std::map to implement, define my own sort function