calculating RD before the match