First pass at integrating docmd functionality. DOES NOT WORK!!