mpd struct and funs