Restored mkd function