add rel_read and part of rel_output
fix merge conflicts