added addMPD function to read stdin