xmd_read n write are lookin better, but still a tad buddy
buggy