added r_{in/out} modules
added r_{in,out} functions