cleaned up md, added a test or two