created read_ir, function for reading individual value