inserted code for calculating matchContent value