updated to write to md file