Final version for rsnout analysis