Implemented matching algorithm for gender