Midifed code according to pmd scan