Moved the candidates generation code to rematchr.py, making sure that the match would succeed.