adds R markcode; some other changes