fixed typo
added medd function